{  Statement: http://acmp.ru/?main=task&id_task=63
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,j,a,b:longint;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(a,b);
for i:=1 to 1000 do
    for j:=1 to 1000 do
        if (i + j = a) and (i * j = b) then begin
            write(i,' ',j);
            halt(0);
        end;
end.